package com.lyy.demo.openapi.knife;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * swagger显示枚举描述注解
 * <pre>
 * {@code
 * @Getter
 * @SwaggerDisplayEnum
 * @AllArgsConstructor
 * public enum SexEnum implements BaseEnum {
 *
 *     UNKNOWN(0, "未知"),
 *     MALE(1, "男"),
 *     FEMALE(2, "女"),
 *     ;
 *
 *     @JsonValue
 *     private final Integer code;
 *     private final String desc;
 * }
 * }
 * </pre>
 * <pre>
 * {@code
 * @Getter
 * @SwaggerDisplayEnum(code = "key", desc = "remark")
 * @AllArgsConstructor
 * public enum UserTypeEnum {
 *
 *     STUDENT("student", "学生"),
 *     TEACHER("teacher", "老师"),
 *     ;
 *
 *     @JsonValue
 *     private final String key;
 *     private final String remark;
 * }
 * }
 * </pre>
 * @author lyy
 * @date 2018/9/29
 */
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface SwaggerDisplayEnum {
    String code() default "code";
    String desc() default "desc";
}